<template>
  <ul class="todo-main">
    <!-- 子组件复用，需要props传递数据给子组件 -->
    <Behavior
      v-for="todoObj in todoList"
      :key="todoObj.id"
      :todo="todoObj"
    ></Behavior>
  </ul>
</template>

<script>
// 引入子组件
import Behavior from "./Behavior.vue";

export default {
  // eslint-disable-next-line vue/multi-word-component-names
  name: "BehaviorList",
  components: {
    Behavior,
  },
  props: ["todoList"],
};
</script>

<style scoped>
/*main*/
.todo-main {
  margin-left: 0px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 0px;
}

.todo-empty {
  height: 40px;
  line-height: 40px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding-left: 5px;
  margin-top: 10px;
}
</style>

